package com.tyx.chargingpile.Enum;

/**
 * 电桩报文枚举
 */
public enum ServiceMessageEume {
    REGISTER("01","电桩注册","message/registerUp.xml","message/registerDown.xml","chargingPileRegister"),
    HEART("22","电桩心跳","message/heartUp.xml","message/heartDown.xml","chargingPileHeart"),
    PILETIME("08","电桩校时","message/pileTimeUp.xml","message/pileTimeDown.xml","chargingPileTimeUp"),
    RECORD("23","充电记录","message/chargeRecordReportUp.xml","message/chargeRecordReportDown.xml","chargingPileRecord"),
    OPEND("21","远程开启放电","message/remoteOpenElectricUp.xml","message/remoteOpenElectricDown.xml","chargingPileOpenUp"),
    STOP("07","远程停止放电","message/remoteStopElectricUp.xml","message/remoteStopElectricDown.xml","chargingPileCloseUp"),
    ELECTRICPRICE("09","电价下发","message/electricPriceUp.xml","message/electricPriceDown.xml","chargingPileElectricPriceUp"),
    REPORTCHECK("2A","刷卡信息上报请求鉴权","message/cardMsgReportCheckUp.xml","message/cardMsgReportCheckDown.xml","chargingPileCardMsgReportCheck"),
    REPORTCHECKRESULT("2B","卡鉴权结果返回","message/cardMsgReportCheckResultUp.xml","message/cardMsgReportCheckResultDown.xml","chargingPileCardMsgReportCheckResultUp"),
    CHARGEREPORTCHOOSEMODE("2D","线下充电上报选择模式","message/offlineChargeReportChooseModelUp.xml","message/offlineChargeReportChooseModelDown.xml","chargingPileChargeReportChooseModel"),
    VINCODECHECK("32","vin码鉴权请求","message/vinCodeCheckUp.xml","message/vinCodeCheckDown.xml","chargingPileVinCodeCheckUp"),
    VINCODECHECKRESULT("33","vin码鉴权结果","message/vinCodeCheckResultUp.xml","message/vinCodeCheckResultDown.xml","chargingPileVinCodeCheckResultDown")
    ;


    ServiceMessageEume(String code,String tile,String upLinePath,String dwnLinePath,String beanName){
        this.code = code;
        this.title = tile;
        this.dwnLinePath = dwnLinePath;
        this.upLinePath = upLinePath;
        this.beanName = beanName;
}

    /**
     * 根据code获取电桩业务枚举
     * @param code
     * @return
     */
    public static ServiceMessageEume getEume(String code){
        for (ServiceMessageEume eume:ServiceMessageEume.values()){
            if(eume.getCode().equals(code)){
                return eume;
            }
        }
        return null;
    }
    /**
     * 控制为代码
     */
    private String code;

    /**
     * 报文标题
     */
    private String title;

    /**
     * 上行报文路径
     */
    private String upLinePath;

    /**
     * 下行报文路径
     */
    private String dwnLinePath;

    /**
     * bena名称
     */
    private String beanName;

    /** bena名称 */
    public String getBeanName() {
        return beanName;
    }

    /** bena名称 */
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    /** 控制为代码 */
    public String getCode() {
        return code;
    }

    /** 控制为代码 */
    public void setCode(String code) {
        this.code = code;
    }

    /** 报文标题 */
    public String getTitle() {
        return title;
    }

    /** 报文标题 */
    public void setTitle(String title) {
        this.title = title;
    }

    /** 上行报文路径 */
    public String getUpLinePath() {
        return upLinePath;
    }

    /** 上行报文路径 */
    public void setUpLinePath(String upLinePath) {
        this.upLinePath = upLinePath;
    }

    /** 下行报文路径 */
    public String getDwnLinePath() {
        return dwnLinePath;
    }

    /** 下行报文路径 */
    public void setDwnLinePath(String dwnLinePath) {
        this.dwnLinePath = dwnLinePath;
    }
}
